import srollListItem from './srollListItem.js';

export default {
	name: 'singleItem',
	components: {
		srollListItem
	},
	props: ['iconType',
		'onRadioToggle',
		'onRadioLabelToggle',
		'entityData',
		'showCheckbox',
		'checked',
		'showOtherProp',
		'otherProps',
		'model',
		'currentId'],
	render(createElement) {
		const { $props } = this;
		const { entityData,
			showCheckbox,
			checked,
			showOtherProp,
			otherProps,
			model,
			onRadioToggle,
			onRadioLabelToggle,
			iconType,
			currentId
		} = $props;
		return (
			<div class={['checkbox-item',currentId === entityData.$_selectKey?'checkbox-item-active':'',showCheckbox?'':'checkbox-item-hiden']}>
				<a-radio
					class="checkbox-item-checkbox"
					value={entityData.$_selectKey}
					disabled={entityData.$_isDisabled}
					checked={checked}
					v-show={showCheckbox}
					onChange={onRadioToggle}
				>
				</a-radio>
				<srollListItem entityData={entityData}
					showOtherProp={showOtherProp}
					otherProps={otherProps}
					onRadioLabelToggle={onRadioLabelToggle}
					smodel={model}
					iconType={iconType}>
				</srollListItem>
			</div>
		);
	}

};
